//By Francois Budin
#ifndef TabND_h
#define TabND_h

#include <iostream>
#include "Exception.h"
#include <stdarg.h>
#include <typeinfo.h>
#include <string>


namespace FPTK{
template<class T>
class TabND{
public:
    TabND(int _NbDim,long _SizeDim1,...);
    TabND(int _NbDim,long *_SizeDim);
    void Constructor();
    ~TabND();
    TabND (const TabND<T>& t);
    //template<class C> TabND<C> Cast();
    template<class C> operator TabND<C> const() const;
    //T GetElement(unsigned long i,unsigned long j);
    const T GetElement(long pos1,long pos2,...) const;
    const T GetElement(unsigned long pos) const;
    void SetElement(T value,long pos1,long pos2,...);
    void SetElement(T value,unsigned long pos);
    void Zeros();
    void Fill(T _var);
	TabND<T> RemoveLineTabND(int numdim,long numline) const;
	TabND<T> ResizeTabND(int numdim,long infirst,long inlast,long newsize) const;
    //TabND<T> ResizeTabND(int numdim,long newsize) const;
    //unsigned long GetNbColumn();
    //unsigned long GetNbRow();
	
    const int GetNbDim() const;
    const long GetSizeDim(int i) const;
    const unsigned long GetSizeAddDim(int i) const;
    bool operator==(const TabND<T>& t2) const;
    bool operator!=(const TabND<T>& t2) const;
    TabND<T> operator=(const TabND<T>& t2);
    const std::string GetType() const;

protected:
    unsigned long size;
    int NbDim;
    long *SizeDim;
    unsigned long *SizeAddDim;
    T *tab;
    std::string type;
};

}//end namespace FPTK

#include "TabND.cxx"

#endif